package ferp.android.views.table.element.image;

import android.content.Context;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import ferp.android.R;
import ferp.android.views.table.TableView;
import ferp.android.views.table.element.Element;

/**
 * User: olegs
 * Date: 04/01/2015 21:10
 */
public class SandClock extends Element<ImageView>
{
  public SandClock(Context context, TableView parent) {super(context, parent);}

  @Override
  protected final ImageView create(Context context, TableView parent)
  {
    ImageView iv = new ImageView(context);

    iv.setBackgroundResource(R.drawable.sand_clock);

    return iv;
  }

  @Override
  protected final void onShow()
  {
    view.startAnimation(AnimationUtils.loadAnimation(view.getContext(), R.anim.sand_clock_rotate));
  }

  @Override
  protected final void onHide() {view.clearAnimation();}
}
